package components

import java.io.Serializable
import java.util.List
import org.apache.wicket.markup.html.basic.Label
import org.uqbar.wicket.xtend.WicketExtensionFactoryMethods
import org.uqbar.wicket.xtend.XLink
import org.uqbar.wicket.xtend.XListView

class ListViewAndButton<T> extends XListView<T> implements Serializable {
		
		extension WicketExtensionFactoryMethods = new WicketExtensionFactoryMethods
	
	new(String id, List<T> list) {
		super(id, list)
		populateItem = [item |
				item.model = item.modelObject.asCompoundModel
				item.addChild(new Label("atributo", item.modelObject.toString ) )
				item.addChild(new XLink("eliminar") => [ onClick = [| list.remove(item.modelObject) ] ]  )
			]
			
	}
	
	
	
	
		
	
}